From: Yao Wei (魏銘廷) Date: Mon, 29 Aug 2022 08:45:05 +0000 (+0800) Subject: switchMonitor: Fix initial selection on desktop X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~452^2^2~25 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=137c50b6dc7d8a6eec844d7e2baf8aabb3680a89;p=gnome-shell.git switchMonitor: Fix initial selection on desktop Due to !2056 the monitor config is 2 instead of 4 on the desktop. However, the constant `Meta.MonitorSwitchConfigType.UNKNOWN` is fixed to 4, and may cause the initial selection to be out of index thus fail to display the switcher. This replaces the above constant to the actual length of the switcher items. Part-of: --- diff --git a/js/ui/switchMonitor.js b/js/ui/switchMonitor.js index 10b4a50cd..a95c5fa9a 100644 --- a/js/ui/switchMonitor.js +++ b/js/ui/switchMonitor.js @@ -63,7 +63,7 @@ class SwitchMonitorPopup extends SwitcherPopup.SwitcherPopup { _initialSelection() { let currentConfig = Meta.MonitorManager.get().get_switch_config(); - let selectConfig = (currentConfig + 1) % Meta.MonitorSwitchConfigType.UNKNOWN; + let selectConfig = (currentConfig + 1) % this._items.length; this._select(selectConfig); }